package cz.muni.fi.pa165.dundd.soap.server;

import cz.muni.fi.pa165.dundd.dto.AdministratorDTO;
import cz.muni.fi.pa165.dundd.service.AdministratorService;
import java.util.List;
import javax.annotation.Resource;
import javax.jws.WebService;
import javax.xml.ws.WebServiceContext;
import org.springframework.beans.factory.annotation.Autowired;

/**
 *
 * @author xszanto, xdemocko
 */
@WebService(endpointInterface = "cz.muni.fi.pa165.dundd.soap.server.AdministratorSOAP", serviceName = "AdministratorSOAP")
public class AdministratorSOAPImpl implements AdministratorSOAP {

    @Resource
    WebServiceContext wsCtx;
    
    @Autowired
    AdministratorService adminstratorService;

    public void setAdminService(AdministratorService adminService) {
        this.adminstratorService = adminService;
    }

    @Override
    public void createAdministrator(AdministratorDTO admin) {
        adminstratorService.createAdministrator(admin);
    }

    @Override
    public void updateAdministrator(AdministratorDTO admin) {
        adminstratorService.updateAdministrator(admin);
    }

    @Override
    public void deleteAdministrator(AdministratorDTO admin) {
        adminstratorService.deleteAdministrator(admin);
    }

    @Override
    public List<AdministratorDTO> retrieveAllAdministrators() {
        return adminstratorService.retrieveAllAdministrators();
    }

    @Override
    public AdministratorDTO retrieveAdministratorById(Long id) {
        return adminstratorService.retrieveAdministratorById(id);
    }
}